@import "../../style/theme/default";
@import "../../style/mixin/link";

:root .ant-menu-submenu-inline > .ant-menu-submenu-title:after {
  font-size: 16px;
}

.ant-tooltip-inner {
  max-width: 500px;
}

.common-menu {
  display: flex;
  width: 100%;
  height: 100%;
  a {
    text-decoration: none;
    color: inherit;
  }

  @include button-link-masker();
  .icon + span {
    transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  }
  &-left,
  &-right {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #d3d3d3;
    background-color: #fafafa;
    .ant-menu {
      background-color: rgb(250, 250, 250);
      margin-top: 8px;
      .icon {
        font-size: 18px;
        width: 18px;
        height: 18px;
        margin-right: 17px;
      }
      &-item,
      &-submenu > .ant-menu-submenu-title {
        padding: 0 15px !important;
      }
      &-item {
        color: rgba(0, 0, 0, .65);
        left: 0;
        display: flex;
        align-items: center;
      }
    }
    &-header {
      display: flex;
      padding: 0 12px;
      height: 58px;
      line-height: 57px;
      border-bottom: 1px solid #d3d3d3;
      font-size: 18px;
      align-items: center;
      flex-shrink: 0;
      color: rgba(0, 0, 0, .65);
      white-space: nowrap;
      .icon {
        font-size: 24px;
        width: 24px;
        height: 24px;
        margin-right: 14px;
        & + span {
          vertical-align: middle;
        }
      }
    }
    &-content {
      overflow: auto;
      overflow-x: hidden;
      flex-grow: 1;
    }
  }
  &-left {
    position: absolute;
    width: 280px;
    height: 100%;
    z-index: 998;
    transition: all 0.25s;
    left: -280px;
    &.expanded {
      left: 0;
    }
    .ant-menu .ant-menu-item {
      &-selected,
      &-selected:hover {
        color: #fff;
        background-color: $primary-color;
      }
    }
    &-header {
      cursor: pointer;
      position: relative;
      div {
        width: 100%;
        display: flex;
        align-items: center;
      }
    }
  }
  &-right {
    width: 250px;
    transition: width 0.25s;
    .ant-menu {
      border-right: 0;
      &-sub {
        background: #f6f6f6;
      }
      &-submenu-active {
        background-color: transparent;
      }
      &-selected:after,
      &-item-selected:after {
        display: none;
      }
    }
    .ant-menu-item-selected,
    .ant-menu-vertical .ant-menu-submenu-selected,
    &-popup .ant-menu-item-selected {
      color: $primary-color;
      background-color: rgba(140, 158, 255, 0.16) !important;
    }
    &-popup.ant-menu-submenu-popup {
      .ant-menu {
        box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.20), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
        min-width: 130px;
        &-item {
          padding-left: 0;
          padding-right: 20px;
        }
      }
    }

    &-footer {
      border-top: 1px solid #d3d3d3;
      height: 50px;
      line-height: 49px;
      padding: 0 12px;
      cursor: pointer;
    }

    &.collapsed {
      width: 50px;
      .ant-menu-inline-collapsed {
        width: 50px;
      }
      .icon + span {
        max-width: 0;
        display: inline-block;
        opacity: 0;
      }
      .common-menu-right-footer .icon {
        transform: scale(-1);
      }
    }
  }
  &-mask {
    z-index: 997;
    width: 100%;
    height: 100%;
    background-color: #000;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.48;
  }
}
